import vuels from 'vue-ls';
import lodash from 'lodash';
import ElementUI from 'element-ui';
import ItsStorage from 'its-storage';
import Contextmenu from 'vue-contextmenujs';
import swSimpleUploader from '@/components/swSimpleUploader';

ElementUI.Dialog.props.closeOnClickModal.default = false;

export default {
	install(Vue) {
		//加载ElementUI
		Vue.use(ElementUI);

		//加载右键组件
		Vue.use(Contextmenu);

		//分片上传
		Vue.use(swSimpleUploader);

		//lodash 方法
		Vue.prototype.$lodash = lodash;

		//本地存储开始
		Vue.prototype.$local = ItsStorage.create({
			storage: 'local',
			namespace: 'sw_'
		});

		//会话存储
		Vue.prototype.$session = ItsStorage.create({
			storage: 'session',
			namespace: 'sw_'
		});

		//内存存储
		Vue.use(vuels, {
			storage: 'memory',
			name: 'memory',
			namespace: 'sw_'
		});

	}
}